<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template inversive_congruential_engine</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../boost_random/reference.html#doxygen.headers.inversive__congruential_8hpp" title="Header &lt;boost/random/inversive_congruential.hpp&gt;">
<link rel="prev" href="classboost_1_1random_1_1independent__bits__engine.html" title="Class template independent_bits_engine">
<link rel="next" href="inversive__congruential_8hpp_1a70fd194ea5f8599d76496e98cb0412a5.html" title="Type definition hellekalek1995">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1random_1_1independent__bits__engine.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_random/reference.html#doxygen.headers.inversive__congruential_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="inversive__congruential_8hpp_1a70fd194ea5f8599d76496e98cb0412a5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template inversive_congruential_engine</span></h2>
<p>boost::random::inversive_congruential_engine</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_random/reference.html#doxygen.headers.inversive__congruential_8hpp" title="Header &lt;boost/random/inversive_congruential.hpp&gt;">boost/random/inversive_congruential.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> IntType<span class="special">,</span> <span class="identifier">IntType</span> a<span class="special">,</span> <span class="identifier">IntType</span> b<span class="special">,</span> <span class="identifier">IntType</span> p<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">IntType</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a76a55e5a0f0437be23179465ef378518"></a><span class="identifier">result_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#id-1_3_32_5_6_22_1_1_1_9-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="identifier">result_type</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a188c23f9c6c1d99f036dfc1e28f545da"><span class="identifier">min</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="identifier">result_type</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1ac87bd38f50703a2df393aae1ef09c01c"><span class="identifier">max</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#id-1_3_32_5_6_22_1_1_1_10-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a4df22ea45cecbb6d241082a9ee6c45e5"><span class="identifier">inversive_congruential_engine</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a24ab446b538bb7a8e340f778ce7f93e8"><span class="identifier">inversive_congruential_engine</span></a><span class="special">(</span><span class="identifier">IntType</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SeedSeq<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1accbf48672ab9b3ce1e1c52f992ea6f8d"><span class="identifier">inversive_congruential_engine</span></a><span class="special">(</span><span class="identifier">SeedSeq</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> It<span class="special">&gt;</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1ac5b1dd5eeacfe0bca195cf681760888b"><span class="identifier">inversive_congruential_engine</span></a><span class="special">(</span><span class="identifier">It</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">It</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1abeb333952cea11d4a87226642fc37c7d"><span class="identifier">seed</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a762bee3bebf1be7afc48c62acb2ea36d"><span class="identifier">seed</span></a><span class="special">(</span><span class="identifier">IntType</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SeedSeq<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1afa3b3a56d2bf5a562926bcf3de7449ee"><span class="identifier">seed</span></a><span class="special">(</span><span class="identifier">SeedSeq</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> It<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a054685e76353132afbcabfd207fc3f13"><span class="identifier">seed</span></a><span class="special">(</span><span class="identifier">It</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">It</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">IntType</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a038e10a676cea67a23f04978fbcb94ff"><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iter<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1abf6b7a74185c857470a148a833edca43"><span class="identifier">generate</span></a><span class="special">(</span><span class="identifier">Iter</span><span class="special">,</span> <span class="identifier">Iter</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1aeec133826f9bf769c1f69f2610e48db7"><span class="identifier">discard</span></a><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uintmax_t</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#id-1_3_32_5_6_22_1_1_1_11-bb">friend functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">,</span> <span class="keyword">typename</span> Traits<span class="special">&gt;</span> 
    <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1ad6a9202f1eb4b0e37f549a605f4dc2f7"><span class="keyword">operator</span><span class="special">&lt;&lt;</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
               <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">,</span> <span class="keyword">typename</span> Traits<span class="special">&gt;</span> 
    <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span> 
    <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a02b377108499ed23bd7b82d32c5658fe"><span class="keyword">operator</span><span class="special">&gt;&gt;</span></a><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span><span class="special">,</span> 
               <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a5c8f6050fc67b48f1cf187bd092ff2ee"><span class="keyword">operator</span><span class="special">==</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span><span class="special">,</span> 
                  <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html#doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a050602f7a4ad511b67aefabbe16623ae"><span class="keyword">operator</span><span class="special">!=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span><span class="special">,</span> 
                  <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keyword">bool</span> <span class="identifier">has_fixed_range</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">result_type</span> <span class="identifier">multiplier</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">result_type</span> <span class="identifier">increment</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">result_type</span> <span class="identifier">modulus</span><span class="special">;</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">IntType</span> <span class="identifier">default_seed</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.32.5.6.21.3.4"></a><h2>Description</h2>
<p>Instantiations of class template <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code> model a  <a class="link" href="../../boost_random/reference.html#boost_random.reference.concepts.pseudo_random_number_generator" title="Pseudo-Random Number Generator">pseudo-random number generator</a> . It uses the inversive congruential algorithm (ICG) described in</p>
<p> </p>
<div class="blockquote"><blockquote class="blockquote"><p>  "Inversive pseudorandom number generators: concepts, results and links", Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation
 Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman (editors), 1995, pp. 255-262. <a href="ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps" target="_top">ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps</a>  </p></blockquote></div>
<p> </p>
<p>The output sequence is defined by x(n+1) = (a*inv(x(n)) - b) (mod p), where x(0), a, b, and the prime number p are parameters of the generator. The expression inv(k) denotes the multiplicative inverse of k in the field of integer numbers modulo p, with inv(0) := 0.</p>
<p>The template parameter IntType shall denote a signed integral type large enough to hold p; a, b, and p are the parameters of the generators. The template parameter val is the validation value checked by validation.</p>
<p> </p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>  The implementation currently uses the Euclidian Algorithm to compute the multiplicative inverse. Therefore, the inversive generators are about 10-20 times slower than the others (see section"performance"). However, the paper talks of only 3x slowdown, so the Euclidian Algorithm is probably not optimal for calculating the multiplicative inverse.  </p></td></tr>
</table></div>
<p>  </p>
<div class="refsect2">
<a name="id-1.3.32.5.6.21.3.4.7"></a><h3>
<a name="id-1_3_32_5_6_22_1_1_1_9-bb"></a><code class="computeroutput">inversive_congruential_engine</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="keyword">static</span> <span class="identifier">result_type</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a188c23f9c6c1d99f036dfc1e28f545da"></a><span class="identifier">min</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">static</span> <span class="identifier">result_type</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1ac87bd38f50703a2df393aae1ef09c01c"></a><span class="identifier">max</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.32.5.6.21.3.4.8"></a><h3>
<a name="id-1_3_32_5_6_22_1_1_1_10-bb"></a><code class="computeroutput">inversive_congruential_engine</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a4df22ea45cecbb6d241082a9ee6c45e5"></a><span class="identifier">inversive_congruential_engine</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Constructs an <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code>, seeding it with the default seed. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a24ab446b538bb7a8e340f778ce7f93e8"></a><span class="identifier">inversive_congruential_engine</span><span class="special">(</span><span class="identifier">IntType</span> x0<span class="special">)</span><span class="special">;</span></pre>
<p>Constructs an <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code>, seeding it with <code class="computeroutput">x0</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SeedSeq<span class="special">&gt;</span> 
  <span class="keyword">explicit</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1accbf48672ab9b3ce1e1c52f992ea6f8d"></a><span class="identifier">inversive_congruential_engine</span><span class="special">(</span><span class="identifier">SeedSeq</span> <span class="special">&amp;</span> seq<span class="special">)</span><span class="special">;</span></pre>
<p>Constructs an <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code>, seeding it with values produced by a call to <code class="computeroutput">seq.generate()</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> It<span class="special">&gt;</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1ac5b1dd5eeacfe0bca195cf681760888b"></a><span class="identifier">inversive_congruential_engine</span><span class="special">(</span><span class="identifier">It</span> <span class="special">&amp;</span> first<span class="special">,</span> <span class="identifier">It</span> last<span class="special">)</span><span class="special">;</span></pre>
<p>Constructs an <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code>, seeds it with values taken from the itrator range [first, last), and adjusts first to point to the element after the last one used. If there are not enough elements, throws <code class="computeroutput">std::invalid_argument</code>.</p>
<p>first and last must be input iterators. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1abeb333952cea11d4a87226642fc37c7d"></a><span class="identifier">seed</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Calls seed(default_seed) </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a762bee3bebf1be7afc48c62acb2ea36d"></a><span class="identifier">seed</span><span class="special">(</span><span class="identifier">IntType</span> x0<span class="special">)</span><span class="special">;</span></pre>
<p>If c mod m is zero and x0 mod m is zero, changes the current value of the generator to 1. Otherwise, changes it to x0 mod m. If c is zero, distinct seeds in the range [1,m) will leave the generator in distinct states. If c is not zero, the range is [0,m). </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> SeedSeq<span class="special">&gt;</span> <span class="keyword">void</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1afa3b3a56d2bf5a562926bcf3de7449ee"></a><span class="identifier">seed</span><span class="special">(</span><span class="identifier">SeedSeq</span> <span class="special">&amp;</span> seq<span class="special">)</span><span class="special">;</span></pre>
<p>Seeds an <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code> using values from a SeedSeq. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> It<span class="special">&gt;</span> <span class="keyword">void</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a054685e76353132afbcabfd207fc3f13"></a><span class="identifier">seed</span><span class="special">(</span><span class="identifier">It</span> <span class="special">&amp;</span> first<span class="special">,</span> <span class="identifier">It</span> last<span class="special">)</span><span class="special">;</span></pre>
<p>seeds an <code class="computeroutput"><a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a></code> with values taken from the itrator range [first, last) and adjusts <code class="computeroutput">first</code> to point to the element after the last one used. If there are not enough elements, throws <code class="computeroutput">std::invalid_argument</code>.</p>
<p><code class="computeroutput">first</code> and <code class="computeroutput">last</code> must be input iterators. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">IntType</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a038e10a676cea67a23f04978fbcb94ff"></a><span class="keyword">operator</span><span class="special">(</span><span class="special">)</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Returns the next output of the generator. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Iter<span class="special">&gt;</span> <span class="keyword">void</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1abf6b7a74185c857470a148a833edca43"></a><span class="identifier">generate</span><span class="special">(</span><span class="identifier">Iter</span> first<span class="special">,</span> <span class="identifier">Iter</span> last<span class="special">)</span><span class="special">;</span></pre>
<p>Fills a range with random values </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1aeec133826f9bf769c1f69f2610e48db7"></a><span class="identifier">discard</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">uintmax_t</span> z<span class="special">)</span><span class="special">;</span></pre>
<p>Advances the state of the generator by <code class="computeroutput">z</code>. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.32.5.6.21.3.4.9"></a><h3>
<a name="id-1_3_32_5_6_22_1_1_1_11-bb"></a><code class="computeroutput">inversive_congruential_engine</code> friend functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">,</span> <span class="keyword">typename</span> Traits<span class="special">&gt;</span> 
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span> 
  <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1ad6a9202f1eb4b0e37f549a605f4dc2f7"></a><span class="keyword">operator</span><span class="special">&lt;&lt;</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_ostream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span> os<span class="special">,</span> 
             <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span> x<span class="special">)</span><span class="special">;</span></pre>
<p>Writes the textual representation of the generator to a <code class="computeroutput">std::ostream</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">,</span> <span class="keyword">typename</span> Traits<span class="special">&gt;</span> 
  <span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span> 
  <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a02b377108499ed23bd7b82d32c5658fe"></a><span class="keyword">operator</span><span class="special">&gt;&gt;</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">basic_istream</span><span class="special">&lt;</span> <span class="identifier">CharT</span><span class="special">,</span> <span class="identifier">Traits</span> <span class="special">&gt;</span> <span class="special">&amp;</span> is<span class="special">,</span> 
             <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span> x<span class="special">)</span><span class="special">;</span></pre>
<p>Reads the textual representation of the generator from a <code class="computeroutput">std::istream</code>. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a5c8f6050fc67b48f1cf187bd092ff2ee"></a><span class="keyword">operator</span><span class="special">==</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span> x<span class="special">,</span> 
                <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span> y<span class="special">)</span><span class="special">;</span></pre>
<p>Returns true if the two generators will produce identical sequences of outputs. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.headers.classboost_1_1random_1_1inversive__congruential__engine_1a050602f7a4ad511b67aefabbe16623ae"></a><span class="keyword">operator</span><span class="special">!=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span> lhs<span class="special">,</span> 
                <span class="keyword">const</span> <a class="link" href="classboost_1_1random_1_1inversive__congruential__engine.html" title="Class template inversive_congruential_engine">inversive_congruential_engine</a> <span class="special">&amp;</span> rhs<span class="special">)</span><span class="special">;</span></pre>
<p>Returns true if the two generators will produce different sequences of outputs. </p>
</li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2000-2005 Jens Maurer<br>Copyright © 2009, 2010 Steven Watanabe<br>Copyright © 2022-2025 Matt
      Borland<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1random_1_1independent__bits__engine.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_random/reference.html#doxygen.headers.inversive__congruential_8hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="inversive__congruential_8hpp_1a70fd194ea5f8599d76496e98cb0412a5.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
